package com.yonyougov.cruxtestcase.testcase.controlrule.enumvalue.multversion;


import com.yonyougov.cruxtestcase.basecase.BaseCase;
import com.yonyougov.cruxtestcase.dto.BaseResponseDto;
import com.yonyougov.cruxtestcase.dto.BaseTestReqDto;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping ("/api/controlrule/enumvalue/multversion")
@Valid
public class EnumCaseController implements BaseCase {
    private final EnumCaseService enumCaseService;

    public EnumCaseController(EnumCaseService enumCaseService) {
        this.enumCaseService = enumCaseService;
    }

    @Override
    public String getName() {
        return "码值多版本不敏感查询";
    }

    @Override
    public String getRemark() {
        return "默认查询返回不敏感的数据";
    }

    //查不敏感
    @PostMapping ("/testcase")
    @Override
    public BaseResponseDto testcase(@RequestBody BaseTestReqDto baseDto) {
        return enumCaseService.testcase(baseDto);
    }

    //查询全部历史版本
    @PostMapping ("/testcase1")
    public BaseResponseDto testcase1(@RequestBody BaseTestReqDto baseDto) {
        return enumCaseService.testcase1(baseDto);
    }

    //查敏感
    @PostMapping ("/testcase2")
    public BaseResponseDto testcase2(@RequestBody BaseTestReqDto baseDto) {
        return enumCaseService.testcase2(baseDto);
    }

    //新增
    @PostMapping ("/testcase3")
    public BaseResponseDto testcase3(@RequestBody BaseTestReqDto baseDto) {
        return enumCaseService.testcase3(baseDto);
    }

    //修改
    @PostMapping ("/testcase4")
    public BaseResponseDto testcase4(@RequestBody BaseTestReqDto baseDto) {
        return enumCaseService.testcase4(baseDto);
    }

    //变更
    @PostMapping ("/testcase5")
    public BaseResponseDto testcase5(@RequestBody BaseTestReqDto baseDto) {
        return enumCaseService.testcase5(baseDto);
    }
}
